#include "Timer.h"

Timer::Timer()
{
	QueryPerformanceFrequency(&m_ticksPerSecond);
	QueryPerformanceCounter(&m_startTime);
	m_lastTime = m_startTime;
}

Timer::~Timer()
{
}

double Timer::GetElapsedSeconds()
{
    LARGE_INTEGER currentTime;

	QueryPerformanceCounter(&currentTime);

	float seconds =  ((float)currentTime.QuadPart - 
		(float)m_lastTime.QuadPart) / (float)m_ticksPerSecond.QuadPart;

	m_lastTime = currentTime;

	return seconds;	
}